use crate::token::token;

use super::lexer::Lexer;

pub fn TestNextToken(input: String, ts: &[token::Token]) { 
    let mut l = Lexer::new(input);

    for i in 0..9 {
        let tok = l.NextToken();

        if tok.Type != ts[i].Type {
            println!(
                "tests{} - tokentype wrong. expected={:?}, got=={:?}",
                i, ts[i].Type, tok.Type,
            )
        }

        if tok.Literal != ts[i].Literal {
            println!(
                "tests{} - literal wrong. expected=={} , got=={}",
                i, ts[i].Literal, tok.Literal
            )
        }
    }
}
